package cn.com.service.impl;

import cn.com.dao.StudentDao;
import cn.com.dao.impl.StudentDaoImpl;
import cn.com.domain.Student;
import cn.com.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    private StudentDao studentDao=new StudentDaoImpl();
    @Override
    public List<Student> findAll() {
        return studentDao.findAll();
    }

    @Override
    public Student findStudentByname(String stuname) {
        return studentDao.findStudentByname(stuname);
    }

    @Override
    public Student findStudentBysid(int sid) {
        return studentDao.findStudentBysid(sid);

    }

    @Override
    public void addStudent(Student stu) {
        studentDao.addStudent(stu);
    }

    @Override
    public void deleteStudent(Student stu) {
        studentDao.deleteStudent(stu);
    }

    @Override
    public void alterStudent(Student beforestu,Student nowstu) {
        studentDao.alterStudent(beforestu, nowstu);
    }
}
